package com.heima.stroke.handler.valuation;

/**
 * 燃油成本
 * @author wyy
 */
public class FuelCostValuation implements Valuation {

    private Valuation valuation;

    private float fuelCost = 1.0f;  //燃油附加费1次收取1元

    public FuelCostValuation(Valuation valuation) {
        this.valuation = valuation;
    }

    @Override
    public float calculation(float km) {
        float beforeCost = (valuation == null ? 0.0f : valuation.calculation(km));
        return beforeCost + fuelCost;
    }
}
